home *** CD-ROM | disk | FTP | other *** search
- ;
- ;this program tests the d2_asc subroutine
- ;
- ; written by
- ; John O. Battle, N4OE
- ; c/s 73547,3346
- ; 732A Holcomb Bridge Road
- ; Norcross, GA 30071
- ; (404) 449-8536
- ;
- page 62,132
-
- cseg segment para public 'code'
- assume cs:cseg,ds:cseg,es:cseg,ss:cseg
- org 100h
-
- begin:
-
- tester proc near
- assume cs:cseg,ds:cseg
- mov bx,cs
- mov ds,bx
- mov ax,'A'
- mov bx,0
- mov dx,0
- mov cx,17
- tt_1: push ax ;arg3 char
- push bx ;arg2 col
- push dx ;arg1 line
- call d2_asc
- add sp,6
- inc dx ;line
- inc bx ;col
- inc bx
- inc bx
- inc ax ;value
- loop tt_1
- int 20h
- tester endp
-
- daz proc near
- ;
- ;This function prints an ASCIIZ string to the monochrome screen.
- ;
- daz endp
-
-
- d2_asc proc near
- ;
- ;This subroutine writes ascii characters to the monochrome screen.
- ;The character is first pushed onto the stack, then the
- ;screen line and column numbers are pushed.
- ;Next, the function is called, and finally, the stack is fixed.
- ;
- ; push 'A'
- ; push line
- ; push column
- ; call d2
- ; add sp,6 ;fix stack
- ;
- push ds ;10 pushes in all
- push es
- push ax
- push bx
- push cx
- push dx
- push si
- push di
- push bp
- pushf
-
- mov bp,sp ;get args from stack
- mov ax,[bp+22] ;arg 1 (2*10 pushes + 2*1)
- ;screen line number
- mov ah,0
- mov bx,80
- mul bx
- mov bx,[bp+24] ;arg 2 (2*10 pushes + 2*2)
- add ax,bx ;screen column number
- mov dx,ax
- shl dx,1 ;multiply by two
- mov di,dx
- mov dl,[bp+26] ;arg 3 (2*10 pushes + 2*3)
- mov dh,7
- mov bx,0b000h ;monochrome display memory segment
- mov ds,bx
- mov ds:[di],dx ;send to screen
- popf
- pop bp
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- pop ax
- pop es
- pop ds
- ret
-
- d2_asc endp
-
- cseg ends
- end begin